﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net.Sockets;
using System.IO;
namespace TestClient
{
    class Program
    {
        static void Main(string[] args)
        {
            try
            {
                Console.WriteLine("Waiting for keyboard input...");
                String text = Console.ReadLine();
                Console.WriteLine("Input received");
 
                TcpClient c = new TcpClient();
                Console.WriteLine("Connecting to Azure...");
                c.Connect("127.255.0.0", 4321);
                Console.WriteLine("Connected");
 
                Console.WriteLine("Sending to Azure...");
                Stream s = c.GetStream();
                StreamWriter sw = new StreamWriter(s);
                sw.WriteLine(text);
                sw.Flush();
                Console.WriteLine("Sent");
 
               
                s.Close();
               
                c.Close();
 
                Console.WriteLine("Done!");
            }
            catch (Exception x)
            {
                Console.WriteLine(x.Message);
            }
    
            Console.Read();
        }
    }
}
